package com.mobilesales.android.activities;

import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Spinner;

public abstract class ModelActivity<T> extends Activity implements IRefreshable {
	private T model;

	protected void setModel(T model) {
		this.model = model;
	}

	protected T getModel() {
		return this.model;
	}

	protected boolean validate() {
		return true;
	}

	public void finish(View v) {
		finish();
	}
	
	public void fixSpinner(Spinner spinner) {
		 DisplayMetrics d = new DisplayMetrics(); 
		 getWindow().getWindowManager().getDefaultDisplay().getMetrics(d); 
		 int wdt=  d.widthPixels;
		 spinner.getLayoutParams().width=wdt-10;
	}
	
}